<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>个人中心</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="{$smarty.const.PUBLIC_PATH}css/amazeui.min.css"/>
<link rel="stylesheet" href="{$smarty.const.IMAGES_PATH}style.css"/>
<script src="{$smarty.const.PUBLIC_PATH}js/jquery.min.js"></script>
<script src="{$smarty.const.PUBLIC_PATH}js/amazeui.min.js"></script>
<style>
	.order a{
		border:solid 1px white !important;
		box-shadow: 0px 0px 0px white !important;
	}
	.order li{
		padding: 0px;
	}
	.order svg{
		width:60px;
		height: 60px;
		fill:#8E71B2;
	}
	.up-radio-item{
		width: 95%;
		line-height: 60px;
		height: 60px;
	}
	.up-radio-item p{
		line-height: 30px;
		height: 30px;
		margin-top: 0px;
		margin-bottom: 0px;
	}
	.up-radio-item span {
		height:4rem;
	    background: #497bae;
	    color: #fff;
	    line-height: 4rem;
	    margin: 7px 10px 0px 0px;
	    border-radius: 5px;
	    padding: 0px 10px;
	    position: absolute;
	    float: right;
	    right: 0;
	    top: 26px;
}

</style>
</head>

<body>
<div class="container" style="background-color: #ebebeb;">
	<!--引入头文件-->
	{include file="../header.html"}
	<script>$('.title-link').text("我的地址")</script>
	
    <div class="withdrawals-panel" style="height: 700px;">
        	{foreach $address as $k=>$v}
        	<div class="am-radio up-radio-item up-radio-item{math equation=rand(2,4)}" style="position: relative;font-size: 17px;">
              <label>
                <input type="radio" name="doc-radio-1" value="option1" checked style="width: 20px; height: 20px;position: relative; top: 10px;display: none;">
                	<p style="position: relative; top: 16px;left: 4px;"><i class="am-icon-user"></i>{$v.name}<i class="am-icon-phone" style="margin-left: 30px;"></i>{$v.phone}</p>
                	<p style="position: relative;left: 4px;margin-top: 19px;width: 65%;text-overflow:ellipsis;  white-space:nowrap;overflow:hidden;">{$v.province}{$v.city}{$v.town}{$v.detail}</p>
                	{if $v.first==1}
                		<a><span class="am-fr firstaddress" data-uid="{$v.uid}" style="right: 12rem;background-color:rgba(255,255,255,0);">默认</span></a>
                	{else if}
                		<a><span class="am-fr notfirstaddress"  data-tochangeuid="{$v.uid}" style="right: 12rem;">设为默认</span></a>
                	{/if}
                	<a href="{$smarty.const.__CONTROLLER__}/editaddress/uid/{$v.uid}"><span class="am-fr" style="right: 6rem;">修改</span></a>
                	<a href="{$smarty.const.__CONTROLLER__}/deleteaddress/uid/{$v.uid}"><span class="am-fr">删除</span></a>
                	
              </label>
            </div>
            {/foreach}
            <div style="text-align: center;margin-top: 85px;position: relative;width: 100%;">
            	<a href="{$smarty.const.__CONTROLLER__}/addaddress/userid/{$smarty.session.id}" class="am-btn am-btn-danger am-btn-block am-radius" style="width:60%;position: absolute; left: 20%;">添加新地址</a>
            </div>
        </div>
    <footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
        <hr data-am-widget="divider" style="" class="am-divider am-divider-default"/>
      <div class="am-footer-miscs ">
        <p>CopyRight©2014 AllMobilize Inc.</p>
        <p>京ICP备13033158</p>
      </div>
    </footer>
     <!--底部-->
    {include file="../footer.html"}
</div>
<script src="/Home/Public/js/jquery.min.js"></script>
<script>
//　　document.documentElement.style.fontSize = '13px';
	$('.up-radio-item').height($('.up-radio-item').width()*0.17);
//	$('.up-radio-item p').css('font-size',$('.container').width()*0.034+'px');
	$('.notfirstaddress').click(function(){ //设为默认地址
		var data={
				uid:$('.firstaddress').data('uid'),
				tochangeuid:$(this).data('tochangeuid'),
			};
			console.log(data);
		$.post("{$smarty.const.__CONTROLLER__}/setfirstaddress", data, function(ret){
				console.log(ret);
				if(ret) window.location.reload();
			})
	})
</script>
</body>
</html>
